package cn.wangsy.zhidao.p20170113;

public class Computer extends IComputer {

	@Override
	public int add(int a, int b) {
		return a+b;
	}

	@Override
	public double add(double a, double b) {
		return a+b;
	}

	@Override
	public int factorial(int n) {
		int sum = 1;
		for(int i=n;i>0;i--){
			sum *= i;
		}
		return sum;
	}

	@Override
	public int square(int n) {
		return n*n;
	}

}
